<!DOCTYPE html>
<html>
  <title>注册组件语法糖</title>
  <script src="../../js/vue.js"></script>
  <head>
    <meta charset="utf-8" />
  </head>
  <body>
    <div id="div1">
      <cpnlocal></cpnlocal>
      <cpnglobal></cpnglobal>
    </div>
  </body>

  <script>
    Vue.component("cpnglobal", {
      template: `
        <div>
            <h1>语法糖注册全局组件</h1>
        </div>
        `
    });
    const app = new Vue({
      el: "#div1",
      components: {
        cpnlocal: {
          template: `
                <div>
                    <h1>语法糖注册局部组件</h1>
                </div>
              `
        }
      }
    });
  </script>
</html>
